//
//  ViewController.m
//  HelloBeeQuick
//
//  Created by LiYiLin on 16/8/18.
//  Copyright © 2016年 LiYiLin. All rights reserved.
//

#import "ViewController.h"
#import "HBQNetWorkTools.h"


@interface ViewController ()

@end

@implementation ViewController

/*  ============================================================  */
/*  网络接口测试 */
/*  ============================================================  */

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self test1];
//    [self test2];
//    [self test3];
//    [self test4];
//    [self test5];
//    [self test6];
//    [self test7];
//    [self test8];
//    [self test9];
//    [self test10];
//    [self test11];
//    [self test12];
}

#pragma mark - 首页数据
- (void)test1 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/focus.json.php";
    
    NSDictionary *parameters = @{@"call" : @1};
    
    [self loadUrl:urlString parameters:parameters];
}

#pragma mark - 新鲜热卖
- (void)test2 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/firstSell.json.php";
    
    NSDictionary *paramaters = @{@"call": @2};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 程序启动广告
- (void)test3 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/ad.json.php";
    
    NSDictionary *paramaters = @{@"call": @7};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 闪电超市数据
- (void)test4 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/supermarket.json.php";
    
    NSDictionary *paramaters = @{@"call": @5};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 新鲜热卖
- (void)test5 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/firstSell.json.php";
    
    NSDictionary *paramaters = @{@"call": @2};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 搜索最近关键词
- (void)test6 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/search.json.php";
    
    NSDictionary *paramaters = @{@"call": @6};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 搜索返回数据
- (void)test7 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/promotion.json.php";
    
    NSDictionary *paramaters = @{@"call": @8};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 我的订单
- (void)test8 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/MyOrders.json.php";
    
    NSDictionary *paramaters = @{@"call": @13};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 我的优惠券
- (void)test9 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/MyCoupon.json.php";
    
    NSDictionary *paramaters = @{@"call": @9};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 系统消息
- (void)test10 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/SystemMessage.json.php";
    
    NSDictionary *paramaters = @{@"call": @10};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 我的消息
- (void)test11 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/MyAdress.json.php";
    
    NSDictionary *paramaters = @{@"call": @11};
    
    [self loadUrl:urlString parameters:paramaters];
}

#pragma mark - 收获地址
- (void)test12 {
    
    NSString *urlString = @"http://iosapi.itcast.cn/loveBeen/MyAdress.json.php";
    
    NSDictionary *paramaters = @{@"call": @12};
    
    [self loadUrl:urlString parameters:paramaters];
}


- (void)loadUrl:(NSString *)urlString parameters:(NSDictionary *)parameters {
    
    [[HBQNetWorkTools SharedManager]post_RequestWithUrl:urlString parameters:parameters successBlock:^(id responseObjects) {
        
        
        
        NSLog(@"responseObjects -- %@",responseObjects);
        
        
        
    } failureBlock:^(NSError *error) {
        NSLog(@"error -- %@",error);
    }];

}

@end











